package polymorphism;

import java.util.Scanner;

public class Convert {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String num = scanner.next();
        System.out.println(convert_num(num));
    }
    public static int convert_num(String val){
        int return_val=0;
        char[] arr=val.toCharArray();
        for(int i=0;i<arr.length;i++) {
            char c = arr[i];
            while (arr[i] != '\0') {
                if (arr[0] == '+'|| arr[0] == '-') {
                    i++;
                    break;
                } else if ((arr[i] < '9') || (arr[i] > '0')) {
                    i++;
                    break;
                }else {
                    return 0;
                }
            }
            return_val=arr[i];
        }
        return return_val;
    }
}
